/*
 * Copyright (C) 2014 Realtek Semiconductor Corp.
 * All Rights Reserved.
 *
 * This program is the proprietary software of Realtek Semiconductor
 * Corporation and/or its licensors, and only be used, duplicated,
 * modified or distributed under the authorized license from Realtek.
 *
 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 *
 * Purpose : Definition of ME handler: Private Tcont Queue Configuration (65534)
 *
 * Feature : The file includes the following modules and sub-modules
 *           (1) ME handler: Private Tcont Queue Configuration (65534)
 */

#include "app_basic.h"
#include "feature_mgmt.h"

/* Table private pon queue number per tcont configuration attribute index */
#define MIB_TABLE_ME373_ATTR_NUM            (17)
#define MIB_TABLE_ME373_ENTITYID_INDEX      ((MIB_ATTR_INDEX)1)
#define MIB_TABLE_ME373_FIRST_ATTR          ((MIB_ATTR_INDEX)2)
#define MIB_TABLE_ME373_SECOND_ATTR         ((MIB_ATTR_INDEX)3)
#define MIB_TABLE_ME373_THIRD_ATTR          ((MIB_ATTR_INDEX)4)
#define MIB_TABLE_ME373_FORTH_ATTR          ((MIB_ATTR_INDEX)5)
#define MIB_TABLE_ME373_FIFTH_ATTR          ((MIB_ATTR_INDEX)6)
#define MIB_TABLE_ME373_SIXTH_ATTR          ((MIB_ATTR_INDEX)7)
#define MIB_TABLE_ME373_SEVENTH_ATTR        ((MIB_ATTR_INDEX)8)
#define MIB_TABLE_ME373_EIGHTH_ATTR         ((MIB_ATTR_INDEX)9)
#define MIB_TABLE_ME373_NINTH_ATTR          ((MIB_ATTR_INDEX)10)
#define MIB_TABLE_ME373_TENTH_ATTR          ((MIB_ATTR_INDEX)11)
#define MIB_TABLE_ME373_ELEVENTH_ATTR       ((MIB_ATTR_INDEX)12)
#define MIB_TABLE_ME373_TWELFTH_ATTR        ((MIB_ATTR_INDEX)13)
#define MIB_TABLE_ME373_THIRTEENTH_ATTR     ((MIB_ATTR_INDEX)14)
#define MIB_TABLE_ME373_FOURTEENTH_ATTR     ((MIB_ATTR_INDEX)15)
#define MIB_TABLE_ME373_FIFTEENTH_ATTR      ((MIB_ATTR_INDEX)16)
#define MIB_TABLE_ME373_SIXTEENTH_ATTR      ((MIB_ATTR_INDEX)17)

#define MIB_TABLE_ME_373_PART_LEN (25)

/* Table me 373 me stucture */
typedef struct
{
    UINT16  EntityID;
    UINT8   NumOfParts;
    CHAR    Part1[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part2[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part3[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part4[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part5[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part6[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part7[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part8[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part9[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part10[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part11[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part12[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part13[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part14[MIB_TABLE_ME_373_PART_LEN + 1];
    CHAR    Part15[MIB_TABLE_ME_373_PART_LEN + 1];
} __attribute__((packed)) MIB_TABLE_ME373_T;

MIB_TABLE_INFO_T gMibMe373TableInfo;
MIB_ATTR_INFO_T gMibMe373AttrInfo[MIB_TABLE_ME373_ATTR_NUM];
MIB_TABLE_ME373_T gMibMe373DefRow;
MIB_TABLE_OPER_T gMibMe373Oper;

GOS_ERROR_CODE 
omci_mib_me_373_oper_reset(
    UINT32 args_num, ...)
{
    MIB_TABLE_ME373_T   me373;
    UINT32                      loop, offset = 0;
    UINT8                       sample[] = { 
            0x45, 0x63, 0x68, 0x6F, 0x4C,\
            0x69, 0x66, 0x65, 0x20, 0x48,\
            0x47, 0x38, 0x30, 0x31, 0x30,\
            0x48, 0x20, 0x47, 0x50, 0x4F,\
            0x4E, 0x20, 0x54, 0x65, 0x72,\
            0x6D, 0x69, 0x6E, 0x61, 0x6C,\
            0x20, 0x28, 0x43, 0x4C, 0x41,\
            0x53, 0x53, 0x20, 0x42, 0x2B,\
            0x2F, 0x50, 0x52, 0x4F, 0x44,\
            0x55, 0x43, 0x54, 0x20, 0x49,\
            0x44, 0x3A, 0x32, 0x31, 0x30,\
            0x32, 0x33, 0x31, 0x31, 0x42,\
            0x51, 0x50, 0x36, 0x52, 0x47,\
            0x32, 0x30, 0x30, 0x30, 0x30,\
            0x30, 0x38, 0x29 };

    OMCI_LOG(OMCI_LOG_LEVEL_INFO, "Resetting MIB: me373");
    MIB_Default(MIB_TABLE_ME373_INDEX, &me373, sizeof(MIB_TABLE_ME373_T));

    me373.EntityID = 0x0;
    me373.NumOfParts = 3;
    for (loop = 0; loop < me373.NumOfParts; loop++)
    {
        unsigned len = 0;
        offset = MIB_TABLE_ME_373_PART_LEN * loop;

        if ((offset + MIB_TABLE_ME_373_PART_LEN) < sizeof ( sample ))
        {
            len = MIB_TABLE_ME_373_PART_LEN;
        }
        else
        {
            len = sizeof ( sample ) - offset;
        }

        switch (loop)
        {
            case 0:
                memcpy(me373.Part1, sample + offset , sizeof ( char ) * len);
                break;
            case 1:
                memcpy(me373.Part2, sample + offset , sizeof ( char ) * len);
                break;
            case 2:
                memcpy(me373.Part3, sample + offset , sizeof ( char ) * len);
                break;
            case 3 ... 15:
            default:
                break;
        }
        
    }

    GOS_ASSERT(GOS_OK == MIB_Set(MIB_TABLE_ME373_INDEX, &me373, sizeof(MIB_TABLE_ME373_T)));
    OMCI_MeOperCfg(MIB_TABLE_ME373_INDEX, NULL, &me373, MIB_ADD,
                   omci_GetOltAccAttrSet(MIB_TABLE_ME373_INDEX, OMCI_ME_ATTR_ACCESS_SBC), OMCI_MSG_BASELINE_PRI_LOW);

    return GOS_OK;
}

GOS_ERROR_CODE mibTable_init ( MIB_TABLE_INDEX tableId )
{
    UINT8 proprietary_mib_cb_bitmask = 0;

    if (FAL_ERR_NOT_REGISTER == feature_api_is_registered(FEATURE_API_BDP_00000200))
    {
        return GOS_FAIL;
    }

    MIB_TABLE_ME373_INDEX = tableId;
    memset(&(gMibMe373Oper), 0x0, sizeof(MIB_TABLE_OPER_T));

    gMibMe373TableInfo.Name = "HW ME373";
    gMibMe373TableInfo.ShortName = "HW373";
    gMibMe373TableInfo.Desc = "huawei ME373";
    gMibMe373TableInfo.ClassId = (UINT32)(373);
    gMibMe373TableInfo.InitType = (UINT32)(OMCI_ME_INIT_TYPE_ONU);
    gMibMe373TableInfo.StdType = (UINT32)(OMCI_ME_TYPE_PROPRIETARY);
    gMibMe373TableInfo.ActionType = (UINT32)(OMCI_ME_ACTION_SET | OMCI_ME_ACTION_GET);
    gMibMe373TableInfo.pAttributes = &(gMibMe373AttrInfo[0]);
    gMibMe373TableInfo.attrNum = MIB_TABLE_ME373_ATTR_NUM;
    gMibMe373TableInfo.entrySize = sizeof(MIB_TABLE_ME373_T);
    gMibMe373TableInfo.pDefaultRow = &gMibMe373DefRow;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Name   = "EntityID";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "NumOfParts";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].Name      = "Part1";
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "Part2";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "Part3";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "Part4";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "Part5";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name     = "Part6";
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].Name      = "Part7";
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "Part8";
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name       = "Part9";
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name    = "Part10";
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].Name     = "Part11";
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name  = "Part12";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name  = "Part13";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name   = "Part14";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Name   = "Part15";

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Desc   = "Entity ID";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Number of parts";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].Desc      = "Part 1";
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Part 2";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Part 3";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Part 4";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Part 5";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc     = "Part 6";
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc      = "Part 7";
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Part 8";
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc       = "Part 9";
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc    = "Part 10";
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc     = "Part 11";
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc  = "Part 12";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc  = "Part 13";
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc   = "Part 14";
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Desc   = "Part 15";

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].DataType   = MIB_ATTR_TYPE_UINT16;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_UINT8;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].DataType      = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType     = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType      = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType       = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType    = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType     = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType  = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType  = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType   = MIB_ATTR_TYPE_STR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].DataType   = MIB_ATTR_TYPE_STR;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Len    = 2;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 1;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].Len       = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len      = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].Len       = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len        = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len     = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].Len      = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len   = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len   = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len    = 25;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].Len    = 25;


    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex    = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex       = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex      = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex       = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex     = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex      = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex   = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex   = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex    = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].IsIndex    = FALSE;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].MibSave    = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].MibSave       = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave      = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave       = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave        = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave     = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave      = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave   = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave   = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave    = TRUE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].MibSave    = TRUE;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle   = MIB_ATTR_OUT_HEX;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_DEC;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle      = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle     = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle      = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle       = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle    = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle     = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle  = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle  = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle   = MIB_ATTR_OUT_CHAR;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OutStyle   = MIB_ATTR_OUT_CHAR;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc     = OMCI_ME_ATTR_ACCESS_READ;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc        = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc       = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc        = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc         = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc      = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc       = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc    = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc    = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc     = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OltAcc     = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag    = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag       = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag      = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag       = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag        = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag     = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag      = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag   = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag   = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag    = FALSE;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].AvcFlag    = FALSE;

    gMibMe373AttrInfo[MIB_TABLE_ME373_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIRST_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SECOND_ATTR - MIB_TABLE_FIRST_INDEX].OptionType    = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRD_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FORTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType   = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_EIGHTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType    = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_NINTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_ELEVENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType  = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_TWELFTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_THIRTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FOURTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType     = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_FIFTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibMe373AttrInfo[MIB_TABLE_ME373_SIXTEENTH_ATTR - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;

    gMibMe373Oper.meOperCb[PROPRIETARY_MIB_CB_RESET] = omci_mib_me_373_oper_reset;
    gMibMe373Oper.meOperDump = omci_mib_oper_dump_default_handler;
    proprietary_mib_cb_bitmask = (1 << PROPRIETARY_MIB_CB_RESET);


    MIB_InfoRegister(tableId, &gMibMe373TableInfo, &gMibMe373Oper);
    MIB_RegisterCallback(tableId, NULL, NULL);
    MIB_Proprietary_Reg(tableId, proprietary_mib_cb_bitmask);

    return GOS_OK;
}
